package logic;

import environment.Cell;

public class Indy {
	private Cell location;
	private double pathCost = 0;

	public Cell getLocation() {
		return location;
	}

	public void setLocation(Cell location) {
		this.location = location;
	}
	
	public int getX() {
		return location.x;
	}
	
	public int getY() {
		return location.y;
	}
	
	public void move(int x, int y) {
		this.location.x = x;
		this.location.y = y;
	}
	
	public boolean equals(Object obj) {
		if (obj != null && obj instanceof Indy) {
			return ((Indy)obj).location.equals(location);
		} else {
			return false;
		}
	}
	
	public String toString() {
		return "Lara " + this.location; 
	}
	
	public void increaseCost(double cost){
		pathCost += cost;
	}
	
	public Indy clone() {
		Indy newIndy = new Indy();
		
		newIndy.setLocation((Cell)this.getLocation().clone());
		
		return newIndy;
	}
}
